package com.haruhi.event;


import java.util.concurrent.LinkedBlockingQueue;

public class MessageQueue {

    private static final LinkedBlockingQueue<Message> queue = new LinkedBlockingQueue<>();

    public static boolean offer(Message message){
        if(MessageConsumer.started()){
            return queue.offer(message);
        }
        return false;
    }

    public static Message take() throws InterruptedException {
        return queue.take();
    }


}
